package wang;

public class Demo02 {
    private  int age;

    public void setAge(int age) {
        if (age < 1 || age > 120){
            System.out.println("年龄不符合规定");
        }
        this.age = age;
    }
}
